home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / Sound.p < prev    next >
Encoding:
Text File  |  1996-05-29  |  23.3 KB  |  693 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Sound.p
  3.  
  4.      Contains:    Sound Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1.3
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT Sound;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __SOUND__}
  30. {$SETC __SOUND__ := 1}
  31.  
  32. {$I+}
  33. {$SETC SoundIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __COMPONENTS__}
  43. {$I Components.p}
  44. {$ENDC}
  45. {    MixedMode.p                                                    }
  46.  
  47. {$IFC UNDEFINED __MIXEDMODE__}
  48. {$I MixedMode.p}
  49. {$ENDC}
  50.  
  51. {$PUSH}
  52. {$ALIGN MAC68K}
  53. {$LibExport+}
  54. {
  55.                         * * *  N O T E  * * *
  56.  
  57.     This file has been updated to include Sound Manager 3.2 interfaces.
  58.  
  59.     Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  60.     that originally shipped with the PowerMacs. These missing functions and the
  61.     new 3.2 interfaces have been released in the SoundLib library for PowerPC
  62.     developers to link with. The runtime library for these functions are
  63.     installed by Sound Manager 3.2. The following functions are found in SoundLib.
  64.  
  65.         GetCompressionInfo, GetSoundPreference, SetSoundPreference,
  66.         UnsignedFixedMulDiv, SndGetInfo, SndSetInfo
  67. }
  68. {
  69.     Interfaces for Sound Driver, !!! OBSOLETE and NOT SUPPORTED !!!
  70.  
  71.     These items are no longer defined, but appear here so that someone
  72.     searching the interfaces might find them. If you are using one of these
  73.     items, you must change your code to support the Sound Manager.
  74.  
  75.         swMode, ftMode, ffMode
  76.         FreeWave, FFSynthRec, Tone, SWSynthRec, Wave, FTSoundRec
  77.         SndCompletionProcPtr
  78.         StartSound, StopSound, SoundDone
  79. }
  80. CONST
  81.     twelfthRootTwo                = 1.05946309435;
  82.     soundListRsrc                = 'snd ';                        {Resource type used by Sound Manager}
  83.     rate44khz                    = $AC440000;                    {44100.00000 in fixed-point}
  84.     rate22050hz                    = $56220000;                    {22050.00000 in fixed-point}
  85.     rate22khz                    = $56EE8BA3;                    {22254.54545 in fixed-point}
  86.     rate11khz                    = $2B7745D1;                    {11127.27273 in fixed-point}
  87.     rate11025hz                    = $2B110000;                    {11025.00000 in fixed-point}
  88. {synthesizer numbers for SndNewChannel}
  89.     squareWaveSynth                = 1;                            {square wave synthesizer}
  90.     waveTableSynth                = 3;                            {wave table synthesizer}
  91.     sampledSynth                = 5;                            {sampled sound synthesizer}
  92. {old Sound Manager MACE synthesizer numbers}
  93.     MACE3snthID                    = 11;
  94.     MACE6snthID                    = 13;
  95.     kMiddleC                    = 60;                            {MIDI note value for middle C}
  96.     kSimpleBeepID                = 1;                            {reserved resource ID for Simple Beep}
  97.     kFullVolume                    = $0100;                        {1.0, setting for full hardware output volume}
  98.     kNoVolume                    = 0;                            {setting for no sound volume}
  99. {command numbers for SndDoCommand and SndDoImmediate}
  100.     nullCmd                        = 0;
  101.     initCmd                        = 1;
  102.     freeCmd                        = 2;
  103.     quietCmd                    = 3;
  104.     flushCmd                    = 4;
  105.     reInitCmd                    = 5;
  106.     waitCmd                        = 10;
  107.     pauseCmd                    = 11;
  108.     resumeCmd                    = 12;
  109.     callBackCmd                    = 13;
  110.  
  111.     syncCmd                        = 14;
  112.     availableCmd                = 24;
  113.     versionCmd                    = 25;
  114.     totalLoadCmd                = 26;
  115.     loadCmd                        = 27;
  116.     freqDurationCmd                = 40;
  117.     restCmd                        = 41;
  118.     freqCmd                        = 42;
  119.     ampCmd                        = 43;
  120.     timbreCmd                    = 44;
  121.     getAmpCmd                    = 45;
  122.     volumeCmd                    = 46;                            {sound manager 3.0 or later only}
  123.     getVolumeCmd                = 47;                            {sound manager 3.0 or later only}
  124.     waveTableCmd                = 60;
  125.     phaseCmd                    = 61;
  126.  
  127.     soundCmd                    = 80;
  128.     bufferCmd                    = 81;
  129.     rateCmd                        = 82;
  130.     continueCmd                    = 83;
  131.     doubleBufferCmd                = 84;
  132.     getRateCmd                    = 85;
  133.     rateMultiplierCmd            = 86;
  134.     getRateMultiplierCmd        = 87;
  135.     sizeCmd                        = 90;
  136.     convertCmd                    = 91;
  137.     stdQLength                    = 128;
  138.     dataOffsetFlag                = $8000;
  139.  
  140. {channel initialization parameters}
  141. {$IFC OLDROUTINENAMES }
  142.     waveInitChannelMask            = $07;
  143.     waveInitChannel0            = $04;                            {wave table only, Sound Manager 2.0 and earlier}
  144.     waveInitChannel1            = $05;                            {wave table only, Sound Manager 2.0 and earlier}
  145.     waveInitChannel2            = $06;                            {wave table only, Sound Manager 2.0 and earlier}
  146.     waveInitChannel3            = $07;                            {wave table only, Sound Manager 2.0 and earlier}
  147.     initChan0                    = waveInitChannel0;                {obsolete spelling}
  148.     initChan1                    = waveInitChannel1;                {obsolete spelling}
  149.     initChan2                    = waveInitChannel2;                {obsolete spelling}
  150.     initChan3                    = waveInitChannel3;                {obsolete spelling}
  151.  
  152. {$ENDC}
  153.     initChanLeft                = $0002;                        {left stereo channel}
  154.     initChanRight                = $0003;                        {right stereo channel}
  155.     initNoInterp                = $0004;                        {no linear interpolation}
  156.     initNoDrop                    = $0008;                        {no drop-sample conversion}
  157.     initMono                    = $0080;                        {monophonic channel}
  158.     initStereo                    = $00C0;                        {stereo channel}
  159.     initMACE3                    = $0300;                        {MACE 3:1}
  160.     initMACE6                    = $0400;                        {MACE 6:1}
  161.     initPanMask                    = $0003;                        {mask for right/left pan values}
  162.     initSRateMask                = $0030;                        {mask for sample rate values}
  163.     initStereoMask                = $00C0;                        {mask for mono/stereo values}
  164.     initCompMask                = $FF00;                        {mask for compression IDs}
  165.     kUseOptionalOutputDevice    = -1;                            {only for Sound Manager 3.0 or later}
  166.     notCompressed                = 0;                            {compression ID's}
  167.     fixedCompression            = -1;                            {compression ID for fixed-sized compression}
  168.     variableCompression            = -2;                            {compression ID for variable-sized compression}
  169.     twoToOne                    = 1;
  170.     eightToThree                = 2;
  171.     threeToOne                    = 3;
  172.     sixToOne                    = 4;
  173.  
  174.     stdSH                        = $00;                            {Standard sound header encode value}
  175.     extSH                        = $FF;                            {Extended sound header encode value}
  176.     cmpSH                        = $FE;                            {Compressed sound header encode value}
  177.  
  178.     outsideCmpSH                = 0;                            {obsolete MACE constant}
  179.     insideCmpSH                    = 1;                            {obsolete MACE constant}
  180.     aceSuccess                    = 0;                            {obsolete MACE constant}
  181.     aceMemFull                    = 1;                            {obsolete MACE constant}
  182.     aceNilBlock                    = 2;                            {obsolete MACE constant}
  183.     aceBadComp                    = 3;                            {obsolete MACE constant}
  184.     aceBadEncode                = 4;                            {obsolete MACE constant}
  185.     aceBadDest                    = 5;                            {obsolete MACE constant}
  186.     aceBadCmd                    = 6;                            {obsolete MACE constant}
  187.     sixToOnePacketSize            = 8;
  188.     threeToOnePacketSize        = 16;
  189.     stateBlockSize                = 64;
  190.     leftOverBlockSize            = 32;
  191.     firstSoundFormat            = $0001;                        {general sound format}
  192.     secondSoundFormat            = $0002;                        {special sampled sound format (HyperCard)}
  193.     dbBufferReady                = $00000001;                    {double buffer is filled}
  194.     dbLastBuffer                = $00000004;                    {last double buffer to play}
  195.     sysBeepDisable                = $0000;                        {SysBeep() enable flags}
  196.     sysBeepEnable                = 0+(1 * (2**(0)));
  197.     sysBeepSynchronous            = 0+(1 * (2**(1)));                {if bit set, make alert sounds synchronous}
  198.     unitTypeNoSelection            = $FFFF;                        {unitTypes for AudioSelection.unitType}
  199.     unitTypeSeconds                = $0000;
  200.  
  201. { unsigned fixed-point number }
  202.     
  203. TYPE
  204.     UnsignedFixed = LONGINT;
  205.  
  206.     SndCommand = PACKED RECORD
  207.         cmd:                    INTEGER;
  208.         param1:                    INTEGER;
  209.         param2:                    LONGINT;
  210.     END;
  211.  
  212.     SndChannelPtr = ^SndChannel;
  213.  
  214.     SndCallBackProcPtr = ProcPtr;  { PROCEDURE SndCallBack(chan: SndChannelPtr; VAR cmd: SndCommand); }
  215.     SndCallBackUPP = UniversalProcPtr;
  216.  
  217.     SndChannel = PACKED RECORD
  218.         nextChan:                SndChannelPtr;
  219.         firstMod:                Ptr;                                    { reserved for the Sound Manager }
  220.         callBack:                SndCallBackUPP;
  221.         userInfo:                LONGINT;
  222.         wait:                    LONGINT;                                { The following is for internal Sound Manager use only.}
  223.         cmdInProgress:            SndCommand;
  224.         flags:                    INTEGER;
  225.         qLength:                INTEGER;
  226.         qHead:                    INTEGER;
  227.         qTail:                    INTEGER;
  228.         queue:                    ARRAY [0..stdQLength-1] OF SndCommand;
  229.     END;
  230.  
  231. {MACE structures}
  232.     StateBlock = RECORD
  233.         stateVar:                ARRAY [0..stateBlockSize-1] OF INTEGER;
  234.     END;
  235.  
  236.     StateBlockPtr = ^StateBlock;
  237.  
  238.     LeftOverBlock = RECORD
  239.         count:                    LONGINT;
  240.         sampleArea:                PACKED ARRAY [0..leftOverBlockSize-1] OF SInt8;
  241.     END;
  242.  
  243.     LeftOverBlockPtr = ^LeftOverBlock;
  244.  
  245.     ModRef = RECORD
  246.         modNumber:                INTEGER;
  247.         modInit:                LONGINT;
  248.     END;
  249.  
  250.     SndListResource = RECORD
  251.         format:                    INTEGER;
  252.         numModifiers:            INTEGER;
  253.         modifierPart:            ARRAY [0..0] OF ModRef;                    {This is a variable length array}
  254.         numCommands:            INTEGER;
  255.         commandPart:            ARRAY [0..0] OF SndCommand;                {This is a variable length array}
  256.         dataPart:                PACKED ARRAY [0..0] OF SInt8;            {This is a variable length array}
  257.     END;
  258.  
  259.     SndListPtr = ^SndListResource;
  260.  
  261.     SndListHndl = ^SndListPtr;
  262.     SndListHandle = ^SndListPtr;
  263.  
  264. {HyperCard sound resource format}
  265.     Snd2ListResource = RECORD
  266.         format:                    INTEGER;
  267.         refCount:                INTEGER;
  268.         numCommands:            INTEGER;
  269.         commandPart:            ARRAY [0..0] OF SndCommand;                {This is a variable length array}
  270.         dataPart:                PACKED ARRAY [0..0] OF SInt8;            {This is a variable length array}
  271.     END;
  272.  
  273.     Snd2ListPtr = ^Snd2ListResource;
  274.  
  275.     Snd2ListHndl = ^Snd2ListPtr;
  276.     Snd2ListHandle = ^Snd2ListPtr;
  277.  
  278.     SoundHeader = PACKED RECORD
  279.         samplePtr:                Ptr;                                    {if NIL then samples are in sampleArea}
  280.         length:                    LONGINT;                                {length of sound in bytes}
  281.         sampleRate:                UnsignedFixed;                            {sample rate for this sound}
  282.         loopStart:                LONGINT;                                {start of looping portion}
  283.         loopEnd:                LONGINT;                                {end of looping portion}
  284.         encode:                    UInt8;                                    {header encoding}
  285.         baseFrequency:            UInt8;                                    {baseFrequency value}
  286.         sampleArea:                PACKED ARRAY [0..0] OF SInt8;            {space for when samples follow directly}
  287.     END;
  288.  
  289.     SoundHeaderPtr = ^SoundHeader;
  290.  
  291.     CmpSoundHeader = PACKED RECORD
  292.         samplePtr:                Ptr;                                    {if nil then samples are in sample area}
  293.         numChannels:            LONGINT;                                {number of channels i.e. mono = 1}
  294.         sampleRate:                UnsignedFixed;                            {sample rate in Apples Fixed point representation}
  295.         loopStart:                LONGINT;                                {loopStart of sound before compression}
  296.         loopEnd:                LONGINT;                                {loopEnd of sound before compression}
  297.         encode:                    UInt8;                                    {data structure used , stdSH, extSH, or cmpSH}
  298.         baseFrequency:            UInt8;                                    {same meaning as regular SoundHeader}
  299.         numFrames:                LONGINT;                                {length in frames ( packetFrames or sampleFrames )}
  300.         AIFFSampleRate:            extended80;                                {IEEE sample rate}
  301.         markerChunk:            Ptr;                                    {sync track}
  302.         format:                    OSType;                                    {data format type, was futureUse1}
  303.         futureUse2:                LONGINT;                                {reserved by Apple}
  304.         stateVars:                StateBlockPtr;                            {pointer to State Block}
  305.         leftOverSamples:        LeftOverBlockPtr;                        {used to save truncated samples between compression calls}
  306.         compressionID:            INTEGER;                                {0 means no compression, non zero means compressionID}
  307.         packetSize:                INTEGER;                                {number of bits in compressed sample packet}
  308.         snthID:                    INTEGER;                                {resource ID of Sound Manager snth that contains NRT C/E}
  309.         sampleSize:                INTEGER;                                {number of bits in non-compressed sample}
  310.         sampleArea:                PACKED ARRAY [0..0] OF SInt8;            {space for when samples follow directly}
  311.     END;
  312.  
  313.     CmpSoundHeaderPtr = ^CmpSoundHeader;
  314.  
  315.     ExtSoundHeader = PACKED RECORD
  316.         samplePtr:                Ptr;                                    {if nil then samples are in sample area}
  317.         numChannels:            LONGINT;                                {number of channels,  ie mono = 1}
  318.         sampleRate:                UnsignedFixed;                            {sample rate in Apples Fixed point representation}
  319.         loopStart:                LONGINT;                                {same meaning as regular SoundHeader}
  320.         loopEnd:                LONGINT;                                {same meaning as regular SoundHeader}
  321.         encode:                    UInt8;                                    {data structure used , stdSH, extSH, or cmpSH}
  322.         baseFrequency:            UInt8;                                    {same meaning as regular SoundHeader}
  323.         numFrames:                LONGINT;                                {length in total number of frames}
  324.         AIFFSampleRate:            extended80;                                {IEEE sample rate}
  325.         markerChunk:            Ptr;                                    {sync track}
  326.         instrumentChunks:        Ptr;                                    {AIFF instrument chunks}
  327.         AESRecording:            Ptr;
  328.         sampleSize:                INTEGER;                                {number of bits in sample}
  329.         futureUse1:                INTEGER;                                {reserved by Apple}
  330.         futureUse2:                LONGINT;                                {reserved by Apple}
  331.         futureUse3:                LONGINT;                                {reserved by Apple}
  332.         futureUse4:                LONGINT;                                {reserved by Apple}
  333.         sampleArea:                PACKED ARRAY [0..0] OF SInt8;            {space for when samples follow directly}
  334.     END;
  335.  
  336.     ExtSoundHeaderPtr = ^ExtSoundHeader;
  337.  
  338.     ConversionBlock = RECORD
  339.         destination:            INTEGER;
  340.         unused:                    INTEGER;
  341.         inputPtr:                CmpSoundHeaderPtr;
  342.         outputPtr:                CmpSoundHeaderPtr;
  343.     END;
  344.  
  345.     ConversionBlockPtr = ^ConversionBlock;
  346.  
  347.     SMStatus = PACKED RECORD
  348.         smMaxCPULoad:            INTEGER;
  349.         smNumChannels:            INTEGER;
  350.         smCurCPULoad:            INTEGER;
  351.     END;
  352.  
  353.     SMStatusPtr = ^SMStatus;
  354.  
  355.     SCStatus = RECORD
  356.         scStartTime:            UnsignedFixed;
  357.         scEndTime:                UnsignedFixed;
  358.         scCurrentTime:            UnsignedFixed;
  359.         scChannelBusy:            BOOLEAN;
  360.         scChannelDisposed:        BOOLEAN;
  361.         scChannelPaused:        BOOLEAN;
  362.         scUnused:                BOOLEAN;
  363.         scChannelAttributes:    LONGINT;
  364.         scCPULoad:                LONGINT;
  365.     END;
  366.  
  367.     SCStatusPtr = ^SCStatus;
  368.  
  369.     AudioSelection = PACKED RECORD
  370.         unitType:                LONGINT;
  371.         selStart:                UnsignedFixed;
  372.         selEnd:                    UnsignedFixed;
  373.     END;
  374.  
  375.     FilePlayCompletionProcPtr = ProcPtr;  { PROCEDURE FilePlayCompletion(chan: SndChannelPtr); }
  376.     FilePlayCompletionUPP = UniversalProcPtr;
  377.  
  378. CONST
  379.     uppFilePlayCompletionProcInfo = $000000C0; { PROCEDURE (4 byte param); }
  380.  
  381. FUNCTION NewFilePlayCompletionProc(userRoutine: FilePlayCompletionProcPtr): FilePlayCompletionUPP;
  382.     {$IFC NOT GENERATINGCFM }
  383.     INLINE $2E9F;
  384.     {$ENDC}
  385.  
  386. PROCEDURE CallFilePlayCompletionProc(chan: SndChannelPtr; userRoutine: FilePlayCompletionUPP);
  387.     {$IFC NOT GENERATINGCFM}
  388.     INLINE $205F, $4E90;
  389.     {$ENDC}
  390.     
  391. TYPE
  392.     AudioSelectionPtr = ^AudioSelection;
  393.  
  394.     SndDoubleBuffer = PACKED RECORD
  395.         dbNumFrames:            LONGINT;
  396.         dbFlags:                LONGINT;
  397.         dbUserInfo:                ARRAY [0..1] OF LONGINT;
  398.         dbSoundData:            PACKED ARRAY [0..0] OF SInt8;
  399.     END;
  400.  
  401.     SndDoubleBufferPtr = ^SndDoubleBuffer;
  402.  
  403.     SndDoubleBackProcPtr = ProcPtr;  { PROCEDURE SndDoubleBack(channel: SndChannelPtr; doubleBufferPtr: SndDoubleBufferPtr); }
  404.     SndDoubleBackUPP = UniversalProcPtr;
  405.  
  406. CONST
  407.     uppSndDoubleBackProcInfo = $000003C0; { PROCEDURE (4 byte param, 4 byte param); }
  408.  
  409. FUNCTION NewSndDoubleBackProc(userRoutine: SndDoubleBackProcPtr): SndDoubleBackUPP;
  410.     {$IFC NOT GENERATINGCFM }
  411.     INLINE $2E9F;
  412.     {$ENDC}
  413.  
  414. PROCEDURE CallSndDoubleBackProc(channel: SndChannelPtr; doubleBufferPtr: SndDoubleBufferPtr; userRoutine: SndDoubleBackUPP);
  415.     {$IFC NOT GENERATINGCFM}
  416.     INLINE $205F, $4E90;
  417.     {$ENDC}
  418.  
  419. TYPE
  420.     SndDoubleBufferHeader = PACKED RECORD
  421.         dbhNumChannels:            INTEGER;
  422.         dbhSampleSize:            INTEGER;
  423.         dbhCompressionID:        INTEGER;
  424.         dbhPacketSize:            INTEGER;
  425.         dbhSampleRate:            UnsignedFixed;
  426.         dbhBufferPtr:            ARRAY [0..1] OF SndDoubleBufferPtr;
  427.         dbhDoubleBack:            SndDoubleBackUPP;
  428.     END;
  429.  
  430.     SndDoubleBufferHeaderPtr = ^SndDoubleBufferHeader;
  431.  
  432.     SndDoubleBufferHeader2 = PACKED RECORD
  433.         dbhNumChannels:            INTEGER;
  434.         dbhSampleSize:            INTEGER;
  435.         dbhCompressionID:        INTEGER;
  436.         dbhPacketSize:            INTEGER;
  437.         dbhSampleRate:            UnsignedFixed;
  438.         dbhBufferPtr:            ARRAY [0..1] OF SndDoubleBufferPtr;
  439.         dbhDoubleBack:            SndDoubleBackUPP;
  440.         dbhFormat:                OSType;
  441.     END;
  442.  
  443.     SndDoubleBufferHeader2Ptr = ^SndDoubleBufferHeader2;
  444.  
  445.     SoundInfoList = PACKED RECORD
  446.         count:                    INTEGER;
  447.         infoHandle:                Handle;
  448.     END;
  449.  
  450.     SoundInfoListPtr = ^SoundInfoList;
  451.  
  452.     SoundComponentDataPtr = ^SoundComponentData;
  453.  
  454.     SoundComponentData = RECORD
  455.         flags:                    LONGINT;
  456.         format:                    OSType;
  457.         numChannels:            INTEGER;
  458.         sampleSize:                INTEGER;
  459.         sampleRate:                UnsignedFixed;
  460.         sampleCount:            LONGINT;
  461.         buffer:                    ^Byte;
  462.         reserved:                LONGINT;
  463.     END;
  464.  
  465.     
  466.     CompressionInfo = RECORD
  467.         recordSize:                LONGINT;
  468.         format:                    OSType;
  469.         compressionID:            INTEGER;
  470.         samplesPerPacket:        INTEGER;
  471.         bytesPerPacket:            INTEGER;
  472.         bytesPerFrame:            INTEGER;
  473.         bytesPerSample:            INTEGER;
  474.         futureUse1:                INTEGER;
  475.     END;
  476.  
  477.     CompressionInfoPtr = ^CompressionInfo;
  478.  
  479.     CompressionInfoHandle = ^CompressionInfoPtr;
  480.     
  481. { private thing to use as a reference to a Sound Converter }
  482.     SoundConverter = ^LONGINT;
  483.  
  484. { These two routines for Get/SetSoundVol should no longer be used.}
  485. { They were for old Apple Sound Chip machines, and do not support the DSP or PowerMacs.}
  486. { Use Get/SetDefaultOutputVolume instead, if you must change the user's machine.}
  487. {$IFC OLDROUTINENAMES  & NOT GENERATINGCFM }
  488.  
  489. PROCEDURE SetSoundVol(level: INTEGER);
  490. PROCEDURE GetSoundVol(VAR level: INTEGER);
  491.     {$IFC NOT GENERATINGCFM}
  492.     INLINE $205F, $4218, $10B8, $0260;
  493.     {$ENDC}
  494. {$ENDC}
  495.  
  496. FUNCTION SndDoCommand(chan: SndChannelPtr; {CONST}VAR cmd: SndCommand; noWait: BOOLEAN): OSErr;
  497.     {$IFC NOT GENERATINGCFM}
  498.     INLINE $A803;
  499.     {$ENDC}
  500. FUNCTION SndDoImmediate(chan: SndChannelPtr; {CONST}VAR cmd: SndCommand): OSErr;
  501.     {$IFC NOT GENERATINGCFM}
  502.     INLINE $A804;
  503.     {$ENDC}
  504. FUNCTION SndNewChannel(VAR chan: SndChannelPtr; synth: INTEGER; init: LONGINT; userRoutine: SndCallBackUPP): OSErr;
  505.     {$IFC NOT GENERATINGCFM}
  506.     INLINE $A807;
  507.     {$ENDC}
  508. FUNCTION SndDisposeChannel(chan: SndChannelPtr; quietNow: BOOLEAN): OSErr;
  509.     {$IFC NOT GENERATINGCFM}
  510.     INLINE $A801;
  511.     {$ENDC}
  512. FUNCTION SndPlay(chan: SndChannelPtr; sndHdl: SndListHandle; async: BOOLEAN): OSErr;
  513.     {$IFC NOT GENERATINGCFM}
  514.     INLINE $A805;
  515.     {$ENDC}
  516. {$IFC OLDROUTINENAMES }
  517. FUNCTION SndAddModifier(chan: SndChannelPtr; modifier: Ptr; id: INTEGER; init: LONGINT): OSErr;
  518.     {$IFC NOT GENERATINGCFM}
  519.     INLINE $A802;
  520.     {$ENDC}
  521. {$ENDC}
  522. FUNCTION SndControl(id: INTEGER; VAR cmd: SndCommand): OSErr;
  523.     {$IFC NOT GENERATINGCFM}
  524.     INLINE $A806;
  525.     {$ENDC}
  526. { Sound Manager 2.0 and later, uses _SoundDispatch }
  527. FUNCTION SndSoundManagerVersion: NumVersion;
  528.     {$IFC NOT GENERATINGCFM}
  529.     INLINE $203C, $000C, $0008, $A800;
  530.     {$ENDC}
  531. FUNCTION SndStartFilePlay(chan: SndChannelPtr; fRefNum: INTEGER; resNum: INTEGER; bufferSize: LONGINT; theBuffer: UNIV Ptr; theSelection: AudioSelectionPtr; theCompletion: FilePlayCompletionUPP; async: BOOLEAN): OSErr;
  532.     {$IFC NOT GENERATINGCFM}
  533.     INLINE $203C, $0D00, $0008, $A800;
  534.     {$ENDC}
  535. FUNCTION SndPauseFilePlay(chan: SndChannelPtr): OSErr;
  536.     {$IFC NOT GENERATINGCFM}
  537.     INLINE $203C, $0204, $0008, $A800;
  538.     {$ENDC}
  539. FUNCTION SndStopFilePlay(chan: SndChannelPtr; quietNow: BOOLEAN): OSErr;
  540.     {$IFC NOT GENERATINGCFM}
  541.     INLINE $203C, $0308, $0008, $A800;
  542.     {$ENDC}
  543. FUNCTION SndChannelStatus(chan: SndChannelPtr; theLength: INTEGER; theStatus: SCStatusPtr): OSErr;
  544.     {$IFC NOT GENERATINGCFM}
  545.     INLINE $203C, $0510, $0008, $A800;
  546.     {$ENDC}
  547. FUNCTION SndManagerStatus(theLength: INTEGER; theStatus: SMStatusPtr): OSErr;
  548.     {$IFC NOT GENERATINGCFM}
  549.     INLINE $203C, $0314, $0008, $A800;
  550.     {$ENDC}
  551. PROCEDURE SndGetSysBeepState(VAR sysBeepState: INTEGER);
  552.     {$IFC NOT GENERATINGCFM}
  553.     INLINE $203C, $0218, $0008, $A800;
  554.     {$ENDC}
  555. FUNCTION SndSetSysBeepState(sysBeepState: INTEGER): OSErr;
  556.     {$IFC NOT GENERATINGCFM}
  557.     INLINE $203C, $011C, $0008, $A800;
  558.     {$ENDC}
  559. FUNCTION SndPlayDoubleBuffer(chan: SndChannelPtr; theParams: SndDoubleBufferHeaderPtr): OSErr;
  560.     {$IFC NOT GENERATINGCFM}
  561.     INLINE $203C, $0420, $0008, $A800;
  562.     {$ENDC}
  563. { MACE compression routines }
  564. FUNCTION MACEVersion: NumVersion;
  565.     {$IFC NOT GENERATINGCFM}
  566.     INLINE $203C, $0000, $0010, $A800;
  567.     {$ENDC}
  568. PROCEDURE Comp3to1(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  569.     {$IFC NOT GENERATINGCFM}
  570.     INLINE $203C, $0004, $0010, $A800;
  571.     {$ENDC}
  572. PROCEDURE Exp1to3(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  573.     {$IFC NOT GENERATINGCFM}
  574.     INLINE $203C, $0008, $0010, $A800;
  575.     {$ENDC}
  576. PROCEDURE Comp6to1(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  577.     {$IFC NOT GENERATINGCFM}
  578.     INLINE $203C, $000C, $0010, $A800;
  579.     {$ENDC}
  580. PROCEDURE Exp1to6(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  581.     {$IFC NOT GENERATINGCFM}
  582.     INLINE $203C, $0010, $0010, $A800;
  583.     {$ENDC}
  584. { Sound Manager 3.0 and later calls }
  585. FUNCTION GetSysBeepVolume(VAR level: LONGINT): OSErr;
  586.     {$IFC NOT GENERATINGCFM}
  587.     INLINE $203C, $0224, $0018, $A800;
  588.     {$ENDC}
  589. FUNCTION SetSysBeepVolume(level: LONGINT): OSErr;
  590.     {$IFC NOT GENERATINGCFM}
  591.     INLINE $203C, $0228, $0018, $A800;
  592.     {$ENDC}
  593. FUNCTION GetDefaultOutputVolume(VAR level: LONGINT): OSErr;
  594.     {$IFC NOT GENERATINGCFM}
  595.     INLINE $203C, $022C, $0018, $A800;
  596.     {$ENDC}
  597. FUNCTION SetDefaultOutputVolume(level: LONGINT): OSErr;
  598.     {$IFC NOT GENERATINGCFM}
  599.     INLINE $203C, $0230, $0018, $A800;
  600.     {$ENDC}
  601. FUNCTION GetSoundHeaderOffset(sndHandle: SndListHandle; VAR offset: LONGINT): OSErr;
  602.     {$IFC NOT GENERATINGCFM}
  603.     INLINE $203C, $0404, $0018, $A800;
  604.     {$ENDC}
  605. FUNCTION UnsignedFixedMulDiv(value: UnsignedFixed; multiplier: UnsignedFixed; divisor: UnsignedFixed): UnsignedFixed;
  606.     {$IFC NOT GENERATINGCFM}
  607.     INLINE $203C, $060C, $0018, $A800;
  608.     {$ENDC}
  609. FUNCTION GetCompressionInfo(compressionID: INTEGER; format: OSType; numChannels: INTEGER; sampleSize: INTEGER; cp: CompressionInfoPtr): OSErr;
  610.     {$IFC NOT GENERATINGCFM}
  611.     INLINE $203C, $0710, $0018, $A800;
  612.     {$ENDC}
  613. FUNCTION SetSoundPreference(theType: OSType; VAR name: Str255; settings: Handle): OSErr;
  614.     {$IFC NOT GENERATINGCFM}
  615.     INLINE $203C, $0634, $0018, $A800;
  616.     {$ENDC}
  617. FUNCTION GetSoundPreference(theType: OSType; VAR name: Str255; settings: Handle): OSErr;
  618.     {$IFC NOT GENERATINGCFM}
  619.     INLINE $203C, $0638, $0018, $A800;
  620.     {$ENDC}
  621. { Sound Manager 3.1 and later calls }
  622. FUNCTION SndGetInfo(chan: SndChannelPtr; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  623.     {$IFC NOT GENERATINGCFM}
  624.     INLINE $203C, $063C, $0018, $A800;
  625.     {$ENDC}
  626. FUNCTION SndSetInfo(chan: SndChannelPtr; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  627.     {$IFC NOT GENERATINGCFM}
  628.     INLINE $203C, $0640, $0018, $A800;
  629.     {$ENDC}
  630. FUNCTION GetSoundOutputInfo(outputDevice: Component; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  631.     {$IFC NOT GENERATINGCFM}
  632.     INLINE $203C, $0644, $0018, $A800;
  633.     {$ENDC}
  634. FUNCTION SetSoundOutputInfo(outputDevice: Component; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  635.     {$IFC NOT GENERATINGCFM}
  636.     INLINE $203C, $0648, $0018, $A800;
  637.     {$ENDC}
  638.  
  639. {  Sound Manager 3.2 and later calls  }
  640. FUNCTION GetCompressionName(compressionType: OSType; VAR compressionName: Str255): OSErr;
  641.     {$IFC NOT GENERATINGCFM}
  642.     INLINE $203C, $044C, $0018, $A800;
  643.     {$ENDC}
  644. FUNCTION SoundConverterOpen({CONST}VAR inputFormat: SoundComponentData; {CONST}VAR outputFormat: SoundComponentData; VAR sc: SoundConverter): OSErr;
  645.     {$IFC NOT GENERATINGCFM}
  646.     INLINE $203C, $0650, $0018, $A800;
  647.     {$ENDC}
  648. FUNCTION SoundConverterClose(sc: SoundConverter): OSErr;
  649.     {$IFC NOT GENERATINGCFM}
  650.     INLINE $203C, $0254, $0018, $A800;
  651.     {$ENDC}
  652. FUNCTION SoundConverterGetBufferSizes(sc: SoundConverter; inputBytesTarget: LONGINT; VAR inputFrames: LONGINT; VAR inputBytes: LONGINT; VAR outputBytes: LONGINT): OSErr;
  653.     {$IFC NOT GENERATINGCFM}
  654.     INLINE $203C, $0A58, $0018, $A800;
  655.     {$ENDC}
  656. FUNCTION SoundConverterBeginConversion(sc: SoundConverter): OSErr;
  657.     {$IFC NOT GENERATINGCFM}
  658.     INLINE $203C, $025C, $0018, $A800;
  659.     {$ENDC}
  660. FUNCTION SoundConverterConvertBuffer(sc: SoundConverter; inputPtr: UNIV Ptr; inputFrames: LONGINT; outputPtr: UNIV Ptr; VAR outputFrames: LONGINT; VAR outputBytes: LONGINT): OSErr;
  661.     {$IFC NOT GENERATINGCFM}
  662.     INLINE $203C, $0C60, $0018, $A800;
  663.     {$ENDC}
  664. FUNCTION SoundConverterEndConversion(sc: SoundConverter; outputPtr: UNIV Ptr; VAR outputFrames: LONGINT; VAR outputBytes: LONGINT): OSErr;
  665.     {$IFC NOT GENERATINGCFM}
  666.     INLINE $203C, $0864, $0018, $A800;
  667.     {$ENDC}
  668.  
  669.  
  670. CONST
  671.     uppSndCallBackProcInfo = $000003C0; { PROCEDURE (4 byte param, 4 byte param); }
  672.  
  673. FUNCTION NewSndCallBackProc(userRoutine: SndCallBackProcPtr): SndCallBackUPP;
  674.     {$IFC NOT GENERATINGCFM }
  675.     INLINE $2E9F;
  676.     {$ENDC}
  677.  
  678. PROCEDURE CallSndCallBackProc(chan: SndChannelPtr; VAR cmd: SndCommand; userRoutine: SndCallBackUPP);
  679.     {$IFC NOT GENERATINGCFM}
  680.     INLINE $205F, $4E90;
  681.     {$ENDC}
  682.  
  683. {$ALIGN RESET}
  684. {$POP}
  685.  
  686. {$SETC UsingIncludes := SoundIncludes}
  687.  
  688. {$ENDC} {__SOUND__}
  689.  
  690. {$IFC NOT UsingIncludes}
  691.  END.
  692. {$ENDC}
  693.